package com.edu.controller.order;

import com.edu.service.ordertab.OrderService;
import com.edu.service.ordertab.OrderServiceImpl;
import com.edu.utils.ParamFormat;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ZCN
 * @version 1.0
 * @date 2021/11/26 10:57
 */
@WebServlet("/order/successorder")
public class SuccessOrderServlet extends HttpServlet {
    private OrderService orderService = new OrderServiceImpl();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            ParamFormat.format(req, resp);
            Integer id = Integer.valueOf(req.getParameter("id"));

            orderService.successorder(id);

            resp.sendRedirect("/order/queryorder");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
